<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <script src="https://how2j.cn/study/js/jquery/2.0.0/jquery.min.js"></script>
    <link href="https://how2j.cn/study/css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="https://how2j.cn/study/js/bootstrap/3.3.6/bootstrap.min.js"></script>
    <script src="https://how2j.cn/study/vue.min.js"></script>
    <script src="https://how2j.cn/study/axios.min.js"></script>
</head>
        <body>
        <div id="div1">
            <form action="/company/saveCompany" method="get">
            <div style="width: 500px">
                <div class="input-group">
                    <span class="input-group-addon" >公司名称</span>
                    <input readonly type="text" class="form-control" name="companyName" :value="company.companyName" >
                </div>
                <div class="input-group">
                    <span class="input-group-addon" >组织代码</span>
                    <input readonly type="text" class="form-control" name="organizationCode" :value="company.organizationCode" >
                </div>
                <div class="input-group">
                    <span class="input-group-addon" >公司类型</span>
                    <input readonly type="text" class="form-control" name="companyType" :value="company.companyType" >
                </div>
                <div class="input-group">
                    <span class="input-group-addon" >公司行业</span>
                    <input readonly type="text" class="form-control" name="industry" :value="company.industry" >
                </div>
                <div class="input-group">
                    <span class="input-group-addon" >公司地址</span>
                    <input readonly type="text" class="form-control" name="companyAddress" :value="company.companyAddress" >
                </div>
                <div class="input-group">
                    <span class="input-group-addon" >公司邮编</span>
                    <input readonly type="text" class="form-control" name="companyPostcode" :value="company.companyPostcode" >
                </div>
                <div class="input-group">
                    <span class="input-group-addon" >公司注册时间</span>
                    <input readonly type="text" class="form-control" name="businessRegisterTimeStr" :value="company.businessRegisterTime" >
                </div>
                <div class="input-group">
                    <span class="input-group-addon" >公司编号</span>
                    <input readonly type="text" class="form-control" name="businessRegisterNo" :value="company.businessRegisterNo" >
                </div>
                <div class="input-group">
                    <span class="input-group-addon" >公司电话</span>
                    <input readonly type="text" class="form-control" name="phone" :value="company.phone" >
                </div>
                <div class="input-group">
                    <span class="input-group-addon" >公司网页</span>
                    <input readonly type="text" class="form-control" name="companyWeb" :value="company.companyWeb" >
                </div>
                <div class="input-group">
                    <span class="input-group-addon" >公司详情</span>
                    <textarea type="text" readonly class="form-control" name="companyDetails" >{{company.companyDetails}}</textarea>
                </div>
            </div>
            </form>
        </div>
        </body>


        <script>
            function GetQueryString(name)
            {
                var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if(r!=null)return  unescape(r[2]); return null;
            }
            new Vue({
                el:'#div1',
                data:{
                    company:{}
                },
                mounted:function(){ //mounted　表示这个 Vue 对象加载成功了
                    var self = this
                    var id=GetQueryString("id");
                    axios.get("/student/findCompanyById?id="+id).then(function(response) {
                        self.company= response.data; //此时还是字符串
                    })
                },
                methods:{

                }
            })

        </script>
</html>
